class Solution(object):
    def modifyString(self, s):
        t = ''
        n = len(s)
        for i in range(n):
            if s[i] == '?':
                for k in range(26):
                    w = chr(ord('a') + k)
                    if t:
                        if i < n - 1:
                            if w != t[-1] and w != s[i + 1]:
                                t += w
                                break
                        else:
                            if w != t[-1]:
                                t += w
                                break
                    else:
                        if i < n - 1:
                            if w != s[i + 1]:
                                t += w
                                break
                        else:
                            t += w
                            break
            else:
                t += s[i]
        return t